# -*- coding: utf-8 -*-
# 写成Config class会更好，但是懒了
import datetime
import os

APP_NAME = "KUMQUAT KING"

ROOT = os.path.dirname(os.path.abspath(__file__))
LOG_DIR = './logs/'

SERVER_HOST: str = "127.0.0.1"
SERVER_PORT: int = 5004

HEARTBEAT: int = 48

# DB
DBNAME: str = 'instance/kumquat.db'
DATABASE_URI: str = 'sqlite://' + DBNAME
DB_POOL_SIZE: int = 20

JWT_SECRET_KEY: str = 'kumquat_king'
JWT_ACCESS_TOKEN_EXPIRES: datetime.timedelta = datetime.timedelta(days=7)


TORTOISE_ORM = {
    "connections": {"default": DATABASE_URI},
    "apps": {
        "models": {
            "models": ["models"],
            "default_connection": "default",
        },
    },
}

DEFAULT_DATE_FORMAT = "%Y-%m-%d"
BOOK_DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"